/**
 * @filename:CapitalTypeServiceImpl 2023-4-20
 * @project Wonder Java前后台分离框架  1.1.0
 * Copyright(c) 2022 Wonder Co. Ltd.
 * All right reserved.
 */
package com.wonder.app.service.impl;

import com.wonder.app.domain.CapitalType;
import com.wonder.app.domain.MoldChain;
import com.wonder.app.mapper.CapitalTypeDao;
import com.wonder.app.mapper.MoldChainDao;
import com.wonder.app.request.MoldChainRequest;
import com.wonder.app.service.CapitalTypeService;
import com.wonder.app.request.CapitalTypeRequest;
import com.wonder.app.service.MoldChainService;
import com.wonder.common.utils.StringUtils;
import com.wonder.common.utils.MessageUtils;
import com.wonder.common.common.AjaxResult;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * @Description:TODO(模具链类型服务实现)
 *
 * @version: 1.1.0
 * @author: Wonder
 *
 */
@Service

public class MoldChainServiceImpl extends ServiceImpl<MoldChainDao, MoldChain> implements MoldChainService {

    @Override
    public String validate(MoldChain moldChain, String type) {
        return "";
    }

    @Override
    public IPage<MoldChain> selectList(MoldChainRequest request, Page<MoldChain> page) {
        LambdaQueryWrapper<MoldChain> lambdaQueryWrapper = new LambdaQueryWrapper<>();

        if (null != request.getId()) {
            lambdaQueryWrapper.eq(MoldChain::getId, request.getId());
        }


        lambdaQueryWrapper.orderByDesc(MoldChain::getId);
        Page<MoldChain> selectPage = this.baseMapper.selectPage(page, lambdaQueryWrapper);
        return selectPage;
    }
}
